HTMLify
index.html
Views: 411 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>Radial Toggle Social Icons</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" type="text/css" media="screen" href="style.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" /> </head> <body> <div class="buttons"> <button class="buttons__toggle"><i class="fa fa-share-alt"></i></button> <div class="buttons__ctas"> <a class="buttons__cta" href="#" ><i class="fa-brands fa-facebook-f"></i>Facebook</a > <a class="buttons__cta" href="#" ><i class="fa-brands fa-twitter"></i>Twitter</a > <a class="buttons__cta" href="#" ><i class="fa-brands fa-instagram"></i>Instagram</a > <a class="buttons__cta" href="#" ><i class="fa-brands fa-youtube"></i>YouTube</a > <a class="buttons__cta" href="#" ><i class="fa-brands fa-tiktok"></i>TikTok</a > <a class="buttons__cta" href="#" ><i class="fa-brands fa-linkedin-in"></i>LinkedIn</a > </div> </div> <script> const buttonsComponent = document.querySelector(".buttons"); const buttonsToggle = document.querySelector(".buttons__toggle"); buttonsToggle.addEventListener("click", toggleButtons); function toggleButtons() { buttonsToggle.classList.toggle("buttons__toggle--active"); buttonsComponent.classList.toggle("buttons--active"); document.activeElement.blur(); } </script> </body> </html> |